<?php
// start the output buffer
ob_start(); ?>
<?php

$conn = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS);

		mysql_select_db(MYSQL_DB);	

$result = mysql_query("SELECT * FROM ".URL_TABLE);
$num_rows = mysql_num_rows($result);
$number = $num_rows;
$english_format_number = number_format($number);
echo $english_format_number;

?>
<?php
$cachefile = "count_cache.html";
// open the cache file for writing
$fp = fopen($cachefile, 'w');
// save the contents of output buffer to the file
fwrite($fp, ob_get_contents());
// close the file
fclose($fp);
// Send the output to the browser
ob_end_flush();

mysql_close($conn); 

?>
